package com.ttn.student.openfeign.fallback;

import com.ttn.common.core.entity.Result;
import com.ttn.common.core.entity.business.CourseUnit;
import com.ttn.common.core.entity.business.Grade;
import com.ttn.common.core.entity.business.Order;
import com.ttn.student.openfeign.BusinessFeignService;
import org.springframework.cloud.openfeign.FallbackFactory;

public class BusinessFeignServiceFallbackFactory implements FallbackFactory<BusinessFeignService> {

    @Override
    public BusinessFeignService create(Throwable cause) {
        return new BusinessFeignService() {


            @Override
            public Result<Long> serviceQueryCourseUnitVocabularyByCourseUnitId(Integer courseUnitId) {
                return Result.success(0);
            }

            @Override
            public Result serviceQueryCourseUnitGrammarTestByCourseUnitId(Integer courseUnitId) {
                return Result.success(0);
            }

            @Override
            public Result serviceQueryCourseCourseUnitHearingDetailsByCourseUnitId(Integer courseUnitId) {
                return Result.success(0);
            }

            @Override
            public Result serviceQueryCourseUnitOralPracticeByCourseUnitId(Integer courseUnitId) {
                return Result.success(0);
            }

            @Override
            public Result serviceQueryCourseUnitOralConversationByCourseUnitId(Integer courseUnitId) {
                return Result.success(0);
            }

            @Override
            public Result serviceQueryCourseUnitByGrade(Integer gradeId) {
                return Result.success();
            }

            @Override
            public Result serviceQueryCourseUnitNumberByGrade(Integer gradeId) {
                return Result.success(0);
            }

            @Override
            public Result<Integer> serviceQueryQuestionsNumberByUnitId(Integer gradeId) {
                return Result.success(0);
            }

            @Override
            public Result<CourseUnit> serviceQueryCourseUnitByUnitId(Integer unitId) {
                return Result.success();
            }

            @Override
            public Result<Grade> serviceQueryGradeById(Integer id) {
                return Result.success();
            }

            @Override
            public Result<Order> queryServiceOrderDetailsByStudentId(Integer studentId) {
                return null;
            }
        };
    }
}
